<?php
class bannersOnBottomWidgetComponents extends myComponents{

	public function executeRender(){

		$q = Doctrine::getTable('Banner')->createQuery('b')
  		->select('b.*')
  		->from('Banner b')
  		->innerJoin('b.BannerGroup bg')
  		->innerJoin('bg.StructureBannerGroups sbg')
  		->innerJoin('sbg.Structure s WITH s.id = ?', $this->getRoute()->getObject()->getId())
  		->where('bg.type = "bottom"')
  		->orderBy('b.pri desc');

		
		$this->banners = $q->execute();

	}

}
